<template "ui/head_base" />
<template "ui/css" />
<div id="LCMS">
    <header>
        <if $_L['config']['admin']['logo']>
            <div class="main-logo">
                <img src="{{$_L['config']['admin']['logo']}}"/>
            </div>
        </if>
        <ul class="layui-nav main-menu-mobile">
            <li class="layui-nav-item">
                <a href="javascript:;">
                    <span>主菜单</span>
                </a>
                <dl class="layui-nav-child"></dl>
            </li>
        </ul>
        <div class="main-menu" data-url="{{$homeurl}}">
            <ul>
                <li class="no-active">
                    <a href="javascript:;" data-url="{{$homeurl}}">
                        <i class="layui-icon layui-icon-home"></i>首页
                    </a>
                </li>
                <loop $sys,$info>
                    <li>
                        <a href="javascript:;" data-url="{{$info['url']}}">
                            <if $info['name']=="appstore">
                                <i class="layui-icon layui-icon-app"></i>应用
                            </if>
                            <if $info['name']=="user">
                                <i class="layui-icon layui-icon-user"></i>用户
                            </if>
                            <if $info['name']=="backup">
                                <i class="layui-icon layui-icon-template-1"></i>数据
                            </if>
                            <if $info['name']=="config">
                                <i class="layui-icon layui-icon-set"></i>设置
                            </if>
                            <if $info['name']=="update">
                                <i class="layui-icon layui-icon-upload-drag"></i>升级
                            </if>
                        </a>
                        <if $info['name']=="appstore" && $applist && count($applist) gt 1>
                            <ol>
                                <loop $applist,$app>
                                    <li>
                                        <a href="javascript:;" data-url="{{$app['url']}}">
                                            <img src="{{$app['icon']}}" />
                                            <h3>{{$app['title']}} <i>V{{$app['ver']}}</i></h3>
                                        </a>
                                    </li>
                                </loop>
                                <li>
                                    <a href="javascript:;" data-url="{{$info['url']}}">
                                        <h3>更多应用...</h3>
                                    </a>
                                </li>
                            </ol>
                        </if>
                    </li>
                </loop>
            </ul>
        </div>
        <ul class="layui-nav user">
            <if LCMS::SUPER()||$_L['ROOTID']==$_L['LCMSADMIN']['id']||$_L['plugin']['aimodel']['subon']==1>
                <li class="layui-nav-item sys-aichat">
                    <a href="javascript:;" title="AI助手" onclick="LCMS.plugin.aimodel.chat({window:`AI助手`,slide:true})"><img class="layui-anim layui-anim-rotate layui-anim-loop" src="{{$_L['url']['public']}}static/images/ai.webp" /><text>AI助手</text></a>
                    <div class="layui-nav-child"></div>
                </li>
            </if>
            <li class="layui-nav-item sys-notify">
                <a href="javascript:;" title="系统通知">
                    <i class="layui-icon layui-icon-notice"></i>
                    <span class="layui-badge" style="display:none"></span>
                </a>
                <div class="layui-nav-child">
                    <ul class="sys-notify-nodata"></ul>
                    <section onclick="LCMS.util.iframe({
                        title: '系统通知',
                        url: `${LCMS.url.admin}index.php?n=index&a=notify`,
                        shade: true,
                        end: function(){
                            LCMS.plugin.notify();
                        }
                    })">查看更多</section>
                </div>
            </li>
            <li class="layui-nav-item">
                <a class="user-name" href="javascript:;" title="{{$_L['LCMSADMIN']['title']}}" data-name="{{$_L['LCMSADMIN']['name']}}">
                    <if $_L['LCMSADMIN']['headimg']>
                        <img src="{{oss($_L['LCMSADMIN']['headimg'])}}" />
                        <else />
                        <i class="layui-icon layui-icon-username"></i>
                    </if>
                    <span>{{$_L['LCMSADMIN']['title']}}</span>
                </a>
                <dl class="layui-nav-child">
                    <dd>
                        <div style="cursor:pointer;" onclick="LCMS.util.iframe({
                            title: '个人资料',
                            url: `${LCMS.url.admin}index.php?n=user&c=admin&a=profile`,
                            shade: true,
                            area: ['600px', '600px']
                        })">个人资料</div>
                    </dd>
                    <dd>
                        <div style="cursor:pointer;" onclick="LCMS.util.iframe({
                            title: '两步验证',
                            url: `${LCMS.url.admin}index.php?n=user&c=admin&a=profile&action=2fa`,
                            shade: true
                        })">两步验证</div>
                    </dd>
                    <if LCMS::SUPER()||$_L['LCMSADMIN']['god']>
                        <dd>
                            <div style="cursor:pointer;" onclick="LCMS.util.iframe({
                                title: '用户切换 - 超级管理员可快速切换登录任意用户后台',
                                url: `${LCMS.url.admin}index.php?n=user&c=admin&a=god`,
                                shade: true,
                            })">用户切换</div>
                        </dd>
                    </if>
                    <if LCMS::SUPER()>
                        <dd>
                            <div style="cursor:pointer;" onclick="LCMS.util.iframe({
                                title: '清除缓存',
                                url: `${LCMS.url.admin}index.php?n=config&c=admin&a=clear`,
                                shade: true,
                                area: ['300px', '260px']
                            })">清除缓存</div>
                        </dd>
                    </if>
                    <dd>
                        <div style="cursor:pointer;color:#F56C6C;" onclick="location.href=`${LCMS.url.admin}index.php?n=login&a=loginout`"><i class="layui-icon layui-icon-logout" style="font-size:16px !important"></i> 退出</div>
                    </dd>
                </dl>
            </li>
        </ul>
        <ul class="layui-nav custom"></ul>
        <div class="clear"></div>
    </header>
    <section class="tplx-loading" style="height:calc(100% - 60px)"></section>
    <template tplx="lcms_main_index">
        <section id="LBOX">
            <block x-if="iframes[0]">
                <iframe id="LBOX-IFRAME0" frameborder="no" border="0" marginwidth="0" marginheight="0" scrolling="auto" :class="iframes.hide==0?'layui-anim layui-anim-fadeout':''" :src="iframes[0]" :style="iframes.index==0?'z-index:1':''" x-ref="iframe0"></iframe>
            </block>
            <block x-if="iframes[1]">
                <iframe id="LBOX-IFRAME1" frameborder="no" border="0" marginwidth="0" marginheight="0" scrolling="auto" :class="iframes.hide==1?'layui-anim layui-anim-fadeout':''" :src="iframes[1]" :style="iframes.index==1?'z-index:1':''" x-ref="iframe1"></iframe>
            </block>
        </section>
    </template>
</div>
<script class="lcms-main-index" data-update="{{$update}}" data-async="{{$async}}" data-safe="{{$_L['config']['admin']['development']!=1?1:0}}"></script>
<script type="text/template" class="header-custom">
    <li class="layui-nav-item" style="background:{bgcolor} !important">
        <a href="{url}" target="{target}" style="color:{color} !important">
            <i class="layui-icon layui-icon-{icon}"></i>
            <span>{title}</span>
        </a>
    </li>
</script>
<script type="text/javascript">function isIE(){var userAgent=navigator.userAgent,isIE=userAgent.indexOf("compatible")>-1&&userAgent.indexOf("MSIE")>-1,isIE11=userAgent.indexOf("Trident")>-1&&userAgent.indexOf("rv:11.0")>-1;return!!isIE||(!!isIE11||void 0)}isIE()&&(document.body.innerHTML=`<h1 style="text-align:center"><br><br><br>请不要使用IE或者IE内核的浏览器，可使用Chrome浏览器或者其它浏览器极速模式。</h1>`);localStorage.setItem("LCMS_user","{{$_L['LCMSADMIN']['name']}}")</script>
<template "ui/foot_base" />